package com.bestom.waterquality.logic;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import com.bestom.waterquality.R;
import com.bestom.waterquality.entity.Constant;


/**
 * 设备状态
 */
public class DeviceStatus {

    private Context mContext;

    private DeviceStatus() {
    }

    private static DeviceStatus _instance = null;

    public static DeviceStatus getInstance() {
        if (_instance == null)
            _instance = new DeviceStatus();
        return _instance;
    }

    public void setDataAndListen(Context context, View view){

        if (mContext == null){
            mContext = context;
            TextView deviceVersion = view.findViewById(R.id.device_version);
            TextView deviceInfo = view.findViewById(R.id.device_info);
            TextView deviceName = view.findViewById(R.id.device_name);
            TextView deviceType = view.findViewById(R.id.device_type);
            TextView deviceId = view.findViewById(R.id.device_id);

            deviceVersion.setText(Constant.deviceVersion);
            deviceInfo.setText(Constant.deviceInfo);
            deviceName.setText(Constant.deviceName);
            deviceType.setText(Constant.deviceType);
            deviceId.setText(Constant.defDeviceId);
        }
    }
}
